import { QuestionaireInfoQo, QuestionaireInfoQo1 } from '@/services/quest';
import { Questionaire, ExamItem } from '../types';
import DetailListAdapter from './DetailListAdapter';
import QuestAdapter from './QuestAdapter';

export default class ContentAdapter {
  compose() {
    //
  }

  /**
   * 创建以及编辑问卷时上传的适配器
   * @param quest
   * @param details
   * @returns
   */
  parse(
    quest: Questionaire,
    details: ExamItem[],
    userId?: string,
  ): QuestionaireInfoQo {
    const qo: QuestionaireInfoQo = {};
    qo.questionaire = new QuestAdapter().parse(quest, userId);
    qo.details = new DetailListAdapter().parse(details);
    return qo;
  }
}
